'''游戏配置'''

import game_utils as gu
from alien import Alien
import math
class Setting():
    '''游戏设置'''
    def __init__(self):
        self.screen_width = 1024
        self.screen_height = 600
        self.bg_color = gu.color_to_rgb('666600')
        self.max_bullet_num = 5 #同屏最多出现的子弹数量    
        self.rootUrl = ""
        self.alienW = 60
        self.alienH = 58

        self.alien_speed_increase = 0.1
        self.alien_speed_add = float(0)
        
        self.ship_limit = 3 #拥有的飞船数量
        self.shoot_score_add = 10 #击杀一个外星人的得分

    @property
    def screen_size(self):
        return (self.screen_width,self.screen_height)
    @property    
    def alien_info(self):
        
        sw = self.screen_width - self.alienW*2    
        cols = math.ceil(sw/self.alienW/2)
        rows = 3
        count = cols * rows
        return rows,cols,count